package com.xpec.c4.net.codec;

import java.nio.ByteBuffer;

import net.sf.cindy.Packet;
import net.sf.cindy.PacketEncoder;
import net.sf.cindy.Session;
import net.sf.cindy.packet.DefaultPacket;

import com.xpec.c4.codec.amf0.Amf0Codec;

/**
 * AMF3编码器
 * @author lipeilin
 *
 */
public class Amf0Encoder implements PacketEncoder {

	@Override
	public Packet encode(Session session, Object obj) throws Exception {
		Amf0Codec encoder=new Amf0Codec();
		ByteBuffer buffer=encoder.encode(obj);
		return new DefaultPacket(buffer);
	}

}
